package com.gobang.gobangboot.utils;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.gobang.gobangboot.entity.Game.Send;

public class WebSocketUtil {

    public static String getMessage(String type, Object data) throws JsonProcessingException {
        ObjectMapper objectMapper = new ObjectMapper();
        Send send = new Send(type, data);

        return objectMapper.writeValueAsString(send);
    }
}
